;$(function(){
    document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
    		 window.shareData = {
         		    "imgUrl": "http://zhonghang.yangpinjie.com/assets/img/invite/inviteshare.jpg", 
         	        "timeLineLink":"http://zhonghang.yangpinjie.com/invite",
         	        "sendFriendLink":"http://zhonghang.yangpinjie.com/invite",
         	        "weiboLink":"http://zhonghang.yangpinjie.com/invite",
         	        "tTitle": "九方购物中心，盛世起航，邀您莅临！",
         	        "tContent":"",
         	        "fTitle": "九方购物中心，盛世起航，邀您莅临！",
         	        "fContent":"",
         	        "wContent":"九方购物中心，盛世起航，邀您莅临！" 
         };
         // 发送给好友
         WeixinJSBridge.on('menu:share:appmessage', function (argv) {
//        	 $.post("/yao/addshare",{},function(success){
		             WeixinJSBridge.invoke('sendAppMessage', {
		                 "img_url": window.shareData.imgUrl,
		                 "img_width": "156",
		                 "img_height": "156",
		                 "link": window.shareData.sendFriendLink,
		                 "desc": window.shareData.fContent,
		                 "title": window.shareData.fTitle
		             }, function (res) {
		                 //  {"err_msg":"send_app_msg:ok"}
		                 if(res.err_msg=="send_app_msg:ok"){
		
		                 }
		             })
//        		});

         });

         // 分享到朋友圈
         WeixinJSBridge.on('menu:share:timeline', function (argv) {
//        	 $.post("/yao/addshare",{},function(success){
             WeixinJSBridge.invoke('shareTimeline', {
                 "img_url": window.shareData.imgUrl,
                 "img_width": "156",
                 "img_height": "156",
                 "link": window.shareData.sendFriendLink,
                 "desc": window.shareData.tContent,
                 "title": window.shareData.tTitle
             }, function (res) {

             });
//        	 });
         });

     }, false);
    	
    	
});

